package com.feng.newconfig.demos.nacosdiscoveryconsumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class EchoServiceFallback implements FallbackFactory<EchoService> {


    @Override
    public EchoService create(Throwable cause) {
        return message -> {
            log.error("触发熔断", cause);
            return "触发熔断";
        };
    }
}